package org.zhouhe.vo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Method entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "method", catalog = "zpd0t1_db")
public class Method implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 2418568899879862683L;
	private Integer methodId;
	private String methodName;
	private Set<MenuMethod> menuMethods = new HashSet<MenuMethod>(0);

	// Constructors

	/** default constructor */
	public Method() {
	}

	/** full constructor */
	public Method(String methodName, Set<MenuMethod> menuMethods) {
		this.methodName = methodName;
		this.menuMethods = menuMethods;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "method_id", unique = true, nullable = false)
	public Integer getMethodId() {
		return this.methodId;
	}

	public void setMethodId(Integer methodId) {
		this.methodId = methodId;
	}

	@Column(name = "method_name")
	public String getMethodName() {
		return this.methodName;
	}

	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "method")
	public Set<MenuMethod> getMenuMethods() {
		return this.menuMethods;
	}

	public void setMenuMethods(Set<MenuMethod> menuMethods) {
		this.menuMethods = menuMethods;
	}

}